package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv2DomainMapper;
import com.ruoyi.net.domain.ElementOspfv2Domain;
import com.ruoyi.net.service.IElementOspfv2DomainService;

/**
 * 网元-OSPFV2进程配置-域配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv2DomainServiceImpl implements IElementOspfv2DomainService 
{
    @Autowired
    private ElementOspfv2DomainMapper elementOspfv2DomainMapper;

    /**
     * 查询网元-OSPFV2进程配置-域配置
     * 
     * @param id 网元-OSPFV2进程配置-域配置主键
     * @return 网元-OSPFV2进程配置-域配置
     */
    @Override
    public ElementOspfv2Domain selectElementOspfv2DomainById(String id)
    {
        return elementOspfv2DomainMapper.selectElementOspfv2DomainById(id);
    }

    /**
     * 查询网元-OSPFV2进程配置-域配置列表
     * 
     * @param elementOspfv2Domain 网元-OSPFV2进程配置-域配置
     * @return 网元-OSPFV2进程配置-域配置
     */
    @Override
    public List<ElementOspfv2Domain> selectElementOspfv2DomainList(ElementOspfv2Domain elementOspfv2Domain)
    {
        return elementOspfv2DomainMapper.selectElementOspfv2DomainList(elementOspfv2Domain);
    }

    /**
     * 新增网元-OSPFV2进程配置-域配置
     * 
     * @param elementOspfv2Domain 网元-OSPFV2进程配置-域配置
     * @return 结果
     */
    @Override
    public int insertElementOspfv2Domain(ElementOspfv2Domain elementOspfv2Domain)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv2Domain.getId())) {
            elementOspfv2Domain.setId(uuid);
        }
        elementOspfv2Domain.setCreateBy(SecurityUtils.getUsername());
        elementOspfv2Domain.setCreateTime(DateUtils.getNowDate());
        elementOspfv2Domain.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Domain.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2DomainMapper.insertElementOspfv2Domain(elementOspfv2Domain);
    }

    /**
     * 修改网元-OSPFV2进程配置-域配置
     * 
     * @param elementOspfv2Domain 网元-OSPFV2进程配置-域配置
     * @return 结果
     */
    @Override
    public int updateElementOspfv2Domain(ElementOspfv2Domain elementOspfv2Domain)
    {
        elementOspfv2Domain.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Domain.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2DomainMapper.updateElementOspfv2Domain(elementOspfv2Domain);
    }

    /**
     * 批量删除网元-OSPFV2进程配置-域配置
     * 
     * @param ids 需要删除的网元-OSPFV2进程配置-域配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2DomainByIds(String[] ids)
    {
        return elementOspfv2DomainMapper.deleteElementOspfv2DomainByIds(ids);
    }

    /**
     * 删除网元-OSPFV2进程配置-域配置信息
     * 
     * @param id 网元-OSPFV2进程配置-域配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2DomainById(String id)
    {
        return elementOspfv2DomainMapper.deleteElementOspfv2DomainById(id);
    }
}
